package com.note.chh.notebook.Adapter;

import android.view.View;
import android.widget.ImageView;

import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.SizeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.note.chh.notebook.Api.Constant;
import com.note.chh.notebook.R;

/**
 * Created by caihuahui on 2018/3/13.
 */

public class MusicBgAdapter extends BaseQuickAdapter<String,BaseViewHolder> {
    public MusicBgAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        helper.setImageResource(R.id.mImage_music_bg,Constant.mbg[helper.getPosition()]);
        int mbg = SPUtils.getInstance(Constant.SP_NAME).getInt(Constant.KEY_MUSIC_BG, 0);
        if (helper.getPosition()==mbg) {
            helper.setVisible(R.id.mImage_music_select,true);
        }else{
            helper.setVisible(R.id.mImage_music_select,false);
        }
    }
}
